package com.charlotte.study.gupao.strategy.pay;


/**
 * @author junjie.ding
 * @date 2020/3/16
 */
public abstract class Payment {

    public abstract String getName();

    public abstract double queryBalance(String uid);

    public BaseResponse pay(String uid, double amount){
        if(queryBalance(uid) < amount){
            return new BaseResponse("500", "交易失败，余额不足！", null);
        }
        return new BaseResponse("200", "交易成功，支付金额：" + amount, null);
    }
}
